package org.example.product.controller.front;

import org.example.core.utils.R;
import org.example.product.service.SpuInfoService;
import org.example.product.to.order.SpuInfoTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.Set;

/**
 * @author 小杰_cc
 * @version 1.0
 */
@RestController
@RequestMapping("/pms/front/spuInfo")
public class SpuInfoFrontController {

    @Autowired
    private SpuInfoService spuInfoService;

    @PostMapping("/order")
    public R<Map<Long, SpuInfoTo>> spuList(@RequestBody Set<Long> spuIds){
        Map<Long, SpuInfoTo> map = spuInfoService.queryOrderSpuList(spuIds);
        return R.ok(map);
    }
}
